package com.dys.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @className: com.dys.controller.RequestParamAndHeader
 * @description: SpringMVC_控制请求参数和请求头
 * @author: pine cone
 * @version: v1.0.0
 * @createTime: 2024/10/25 21:53
 */
@Controller
public class RequestParamAndHeader {

    @RequestMapping(value = {"rp1.do", "/requestParam.do"}, method = {RequestMethod.GET, RequestMethod.POST}, params = {"username", "username!=root", "password"})
    public String requestParam() {
        System.out.println("springmvc 控制请求参数......");
        return "requestParam.jsp";
    }

    @RequestMapping(value = {"rh.do", "/requestHeader.do"}, method = {RequestMethod.GET, RequestMethod.POST}, headers = {"accept-encoding=gzip, deflate, br, zstd"})
    public String requestHeader() {
        System.out.println("springmvc 控制请求头参数......");
        return "requestHeader.jsp";
    }
}
